#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=60;
typedef long long LL;
const LL mod=1e9+7;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
char str[maxn];
LL solve(LL l1,LL l2,LL r1,LL r2){
   LL sum=0;
   for(LL i=l1;i<=l2;i++){
      sum=(sum*10%mod+(str[i]-'0')%mod)%mod;
   }
   for(LL i=r1;i<=r2;i++){
      sum=(sum*10%mod+(str[i]-'0')%mod)%mod;
   }
   return sum%mod;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>(str+1);
  LL len=strlen(str+1);
  LL ans=0;
  for(LL l=1;l<=len;l++){
    for(LL r=l;r<=len;r++){
        if(l==1&&r==len) continue;
        LL t=solve(1,l-1,r+1,len);
     ///   debug(t);
        ans=(ans%mod+solve(1,l-1,r+1,len)%mod)%mod;
    }
  }
  cout<<ans<<"\n";
return 0;
}
